package com.wdcloud.netlibrary.deliver;


import com.wdcloud.netlibrary.callback.BaseCallback;
import com.wdcloud.netlibrary.callback.DownloadProgressCallback;
import com.wdcloud.netlibrary.callback.NetWorkCallback;

/**
 */
public class NativeDeliver implements IDeliver {


    public NativeDeliver() {

    }


    public void deliverStart(final BaseCallback callback) {
        callback.onStart();
    }

    public <T> void deliverSuccess(final NetWorkCallback<T> callback, final T t) {
        callback.onSuccess(t);
    }

    public void deliverComplete(final BaseCallback callback) {
        callback.onComplete();

    }

    public void deliverCancel(final BaseCallback callback) {
        callback.onCancel();
    }

    public void deliverFail(final BaseCallback callback, final Exception e) {

        callback.onFail(e);
    }

    public void deliverProgress(final DownloadProgressCallback callback,
                                final long current, final long total, final int progress) {
        callback.onProgress(current, total, progress);
    }
}
